Skip to content

Remove payment cron when all gateways are disconnected#3160

Merged
Crabcyborg merged 3 commits into
masterfrom
remove_payment_cron_when_all_gateways_are_disconnected
Jun 22, 2026
Merged

Remove payment cron when all gateways are disconnected#3160
Crabcyborg merged 3 commits into
masterfrom
remove_payment_cron_when_all_gateways_are_disconnected

Conversation

@Crabcyborg

@Crabcyborg Crabcyborg commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Related ticket https://secure.helpscout.net/conversation/3358713219/253763

Summary

  • The frm_payment_cron cron is scheduled when the payments tables are created.
  • It would only get unscheduled when deactivating Lite, or when disconnecting both Stripe gateways.

The solution

  • This update adds new hooks for when a payment gateway is disconnected. It checks in this hook if all gateways are disconnected. If they are, the payment cron should automatically get unscheduled (and no longer appear in the WP Control settings).

You can use the WP Crontrol plugin to view your Cron events.

Screenshot 2026-06-18 at 4 58 30 PM

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Crabcyborg, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 4 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a9b50093-e4b0-4974-8ee7-17b3fcef6210

📥 Commits

Reviewing files that changed from the base of the PR and between 31e33e2 and cbd82bd.

📒 Files selected for processing (7)
  • classes/controllers/FrmAppController.php
  • paypal/helpers/FrmPayPalLiteConnectHelper.php
  • square/helpers/FrmSquareLiteConnectHelper.php
  • stripe/controllers/FrmTransLiteAppController.php
  • stripe/controllers/FrmTransLiteHooksController.php
  • stripe/helpers/FrmStrpLiteConnectHelper.php
  • stripe/helpers/FrmTransLiteAppHelper.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove_payment_cron_when_all_gateways_are_disconnected

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@deepsource-io

deepsource-io Bot commented Jun 18, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 31e33e2...cbd82bd on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Jun 18, 2026 7:31p.m. Review ↗
JavaScript Jun 18, 2026 7:31p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

@Crabcyborg Crabcyborg changed the title Remove paypal cron when all gateways are disconnected Remove payment cron when all gateways are disconnected Jun 18, 2026
@Crabcyborg
Crabcyborg requested a review from garretlaxton June 18, 2026 20:02

@garretlaxton garretlaxton left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works good!

@Crabcyborg

Copy link
Copy Markdown
Contributor Author

Thank you @garretlaxton!

🚀

@Crabcyborg
Crabcyborg merged commit 1334253 into master Jun 22, 2026
22 checks passed
@Crabcyborg
Crabcyborg deleted the remove_payment_cron_when_all_gateways_are_disconnected branch June 22, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants